<template>
	<view class="">
		<view class="record-item flex" v-for="(item,index) in list" :key="index">
			<image :src="item.pic" mode="aspectFill" class="record-img" />
			<view class="">
				<view class="record-name">{{item.title}}</view>
				<view class="">
					<text class="c-gray">时间：</text>
					<text>{{item.createtime}}</text>
				</view>
				<view class="">
					<text class="c-gray">泌豆：</text>
					<text class="c-red">-{{item.totalscore}}泌豆</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		shoppingExchangeMsg
	} from "../../api/index.js"
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.getShoppingExchangeMsg()
		},
		methods: {
			async getShoppingExchangeMsg() {
				const res = await shoppingExchangeMsg('s=/ApiScoreshop/scorejl')
				const {
					data,
					status,
					msg
				} = res.data
				console.log(res, "---")
				if (status == 1) {
					this.list=data
				} else {
					this.showToast(msg)
				}

			},

		}
	}
</script>

<style>
	page {
		background-color: #F7F7F7;
	}
</style>

<style lang="scss" scoped>
	.record-item {
		margin: 20rpx;
		background-color: #FFF;
		padding: 27rpx 20rpx;
		font-size: 24rpx;
		border-radius: 20rpx;

		.record-img {
			width: 160rpx;
			height: 160rpx;
			border-radius: 13rpx;
			margin-right: 24rpx;
		}

		.record-name {
			font-size: 29rpx;
			font-weight: bold;
			margin-bottom: 32rpx;
		}
	}
</style>
